package cz.semjobKB.search.api;

import java.util.List;

/**
 * Interface declares method to create and operate with one rule of the rule set
 */
public interface IRule {

    /**
     * Gets the name of the rule
     * @return  Rule name
     */
	String getName();

    /**
     * False if the rule is a predicate and the rule consists only from the basic rule.
     * Example: If the rule is just predicate and other rule has predicate and auxiliary verb. Then if the sentence
     * has predicate and also auxiliary verb, then both rules hit a match and the duplicity will occur.
     * To remove the "lesser" match the search engine removes the match from a rule marked as vassal. False if the rule
     * can be the only match for a given triple part.
     * @return True if its a vassal (major rule), false if its a "minor" and other rules can extend him
     */
	boolean isVassal();

    /**
     * Adds node to the rule
     * @param node  Node to add
     * @throws RuleCorrectnessException Exception thrown when the added node breaks the allowed configuration
     */
	void addNode(INodeRule node) throws RuleCorrectnessException;

    /**
     * Gets the nodes
     * @return  List of nodes
     */
	List<INodeRule> getNodes();
}
